Component({
	data: {
		active: 0,
		list: [
			{
        icon: 'home-o',
				text: '点餐',
        url: "/pages/index/index"
			},{
        icon: 'user-o',
        text: '我的',
        url: "/pages/my/index"
      },
		]
	},
	methods: {
		onChange(event) {
      console.log(1111,event.detail)
			wx.switchTab({
				url: this.data.list[event.detail].url
			});
		},
		init() {
      const page = getCurrentPages().pop();
      console.log(page)
			this.setData({
					active: this.data.list.findIndex(item => item.url === `/${page.route}`)
			});
	}
	}
});
